extends ../layout

block css
    link(rel='stylesheet', href='/css/base/ck_base.css', media='screen')
    link(rel='stylesheet', href='/css/user/ck_set.css', media='screen')
block js
    script(src='/js/jquery-1.8.0.min.js')
    script(src='/js/html5.js')
    script(src='/js/jquery.common.js')
    script(src='/js/user/util.js')
block content

    .set_wrap.clearfix
      aside.set_sidebar
        .nav_hd 设置中心
        ul.sidetab
          li
            a.icoR_11(href='/info') 个人资料
          li
            a.icoR_20(href='/info/address') 收货地址
          li
            a.icoR_12(href='/info/icon') 设置头像
          li.curr
            a.icoR_15(href='/info/pwd') 帐号安全
          li
            a.icoR_21(href='/info/school') 所在学校            
      .set_content.accout_safe
        .as_bd.clearfix
          .as_title 帐号安全
          .form_con.clearfix
            .l_t 帐号密码修改
            .formItem.mb20
              label.form_label(for='') 旧密码：
              .form_field
                input#oldpass.form_text(type='password')
            .formItem.mb20
              label.form_label(for='') 新密码：
              .form_field
                input#newpass.form_text(type='password')
            .formItem.mb20
              label.form_label(for='') 确认新密码：
              .form_field
                input#confirmpass.form_text(type='password')
            .formItem
              label.form_label(for='')  
              .form_field
                a#saveBtn1.n_btn38g(href='javascript:;') 保存
        // =E grzl_bd
      script(type='text/javascript').
        $(function () {
        $("#saveBtn1").click(function () {
        var oldpass = $("#oldpass").val();
        var newpass = $("#newpass").val();
        var confirmpass = $("#confirmpass").val();
        var params = "oldpass=" + encodeURIComponent(oldpass) + "&newpass=" + encodeURIComponent(newpass) + "&confirmpass=" + encodeURIComponent(confirmpass);
        $.ajax({
        url: "/info/savePassword",
        type: "post",
        data: params,
        dataType: "json",
        success: function (ret) {
        if (ret.code == 0) {
        $.tipsBoxy({
        type: "success",
        message: "密码修改成功",
        mask: true,
        width: 300,
        callback: function () {
        document.location.reload();
        }
        });
        } else {
        $.tipsBoxy({type: "error", message: ret.result, mask: true, width: 300});
        }
        }
        });
        });
        });
